Layouts Overview
Overview
When a retailer uses Engage content on their site or in email, they need to first create a layout to contain the content, just like they would need to do if they were using Recommend. While Engage layouts are different from Recommend layouts, they serve a common purpose.
One centralized dashboard allows you to create, manage and deliver personalized campaigns across any channels like desktop, phones, tablets, call centers, emails, and in-store.
Before you can use Engage, your Algonomy team will need to set up your account with both Engage and User Profile Service.
How It Works
Engage layouts are slightly different than Recommend layouts. The general idea is the same: the layout holds the JavaScript code that creates a JSON object in the browser when run. However, this object must be saved separately from the RR.data.JSON.placements object. Algonomy recommends creating a RR.data.JSON.content object by including the following line at the start of every layout:
RR.data.JSON.content = RR.data.JSON.content || [];
To put that into context, here is an example layout, with that line correctly inserted:
<script type="text/javascript">
RR.data.JSON.content = RR.data.JSON.content || [];
RR.data.JSON.content.push({
"placement_name": "$PLACEMENT_NAME$",
"asset_image_URL": "$ASSET_IMAGE_URL$",
"asset_image_URL_sp": "$ASSET_IMAGE_URL_SP$",
"asset_size": "$ASSET_SIZE$",
"clickthrough_URL": "$CLICKTHROUGH_URL$",
"render_time": "$RENDER_TIME$",
"view_guid": "$VIEW_GUID$"
});
</script>
Each of the items in the content catalog are included as well, and they hold information that will be rendered into the display when the response comes back.
The line that creates the content object can also be added to the pre-insert JavaScript in the Site Settings Omnichannel Personalization page, but this means that the content object will exist even on pages where no content is returned.